<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>


<h1>详情页</h1>
<h2></h2>
<p></p>


<script src="libs/zepto.js"></script>
<script>

  // ?id=60516e00e843bb1123b6b458 & from=index & uname=hahha

  function getQuery(key) {
    let queryArr = location.search.slice(1).split('&')
    for (let item of queryArr) {
      const item1 = item.split('=')
      if (item1[0] === key) {
        return item1[1]
      }
    }
  }

  Zepto.ajax({
    url: `https://gank.io/api/v2/post/${getQuery('id')}`,
    success(res) {
      console.log(res)
      $('h1').html(res.data.title)
      $('h2').html(res.data.author + res.data.desc)
      $('p').html(res.data.markdown)
    }
  })



</script>

</body>
</html>
